<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/advimg.css">
    <script src='./node_modules/layui/dist/layui.js'></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>

<body>

    <body>

        <div class="layui-fluid ">
            <div class="layui-row layui-col-space15">
                <div class="toggle">
                    <button type="button" class="layui-btn layui-btn-primary layui-border-green active list
                        layui-btn-lg">广告图列表</button>
                    <button type="button" class="layui-btn layui-btn-primary layui-border-green
                        layui-btn-lg">添加广告图</button>
                </div>



                <!-- 表单区域 -->
                <div class="layui-card current" id="jq22">
                    <div class="layui-card-body">
                        <!-- 查询 -->
                        <form class="layui-form query-form" action="" lay-filter="query">
                            <div class="layui-input-inline">
                                <select id="query" name="posid" lay-verify="">
    
                                </select>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="text" name="keys" placeholder="请输入关键字" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <button class="layui-btn query" lay-submit lay-filter="formDemo" style="background-color: #fb6d49 !important">查询</button>
                                    <button type="reset" class="layui-btn layui-btn-primary" id="resetting">重置</button>
                                </div>
                            </div>
                        </form>


                        <table class="layui-table">
                            <colgroup>
                                <col width="100">
                                <col width="150">
                                <col>
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>ID编号</th>
                                    <th>广告位置</th>
                                    <th>广告图</th>
                                    <th>广告位描述</th>
                                    <th>广告链接</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                        <div id="test2"></div>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-body">
                        <form class="layui-form" id="add-form" action="" lay-filter="addForm" style="margin-bottom: 10px;">
                            <input type="hidden" name="act" value="add">

                            <div class="layui-form-item">
                                <label class="layui-form-label">广告图位置</label>
                                <div class="layui-input-block">
                                    <select id="select" value="" name="advimgpos" required lay-verify="required">
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">广告图描述</label>
                                <div class="layui-input-block">
                                    <input type="text" name="advimgdesc" required lay-verify="required" placeholder="请输入描述" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">广告图链接</label>
                                <div class="layui-input-block">
                                    <input type="text" name="advimglink" required lay-verify="required" placeholder="链接地址" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">广告图</label>
                                <div class="layui-input-block">
                                    <button type="button" class="layui-btn" id="test1" style="background-color: #fb6d49 !important">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button> <br>
                                    <br>
                                    <img id="image" src="" alt="" style="max-width: 70px;">

                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo" style="background-color: #fb6d49 !important">立即创建</button>
                                    <button type="reset" class="layui-btn layui-btn-primary quxiao">取消</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <!-- 查询选择 -->
    <script type="text/html" id="tpl-query">
        <option value="">请选择广告位</option>
        {{each data}}
        <option value="{{$value.id}}">{{$value.advposname }}</option>
        {{/each}}
    </script>


    <!-- 下拉选择框 新增form -->
    <script type="text/html" id="tpl-cate">
        <option value="">请选择</option>
        {{each data}}
        <option value="{{$value.advimgpos}}">{{$value.advposname }}</option>
        {{/each}}
    </script>
    <!-- 表单 -->
    <script type="text/html" id="tpl">
        {{each data}}
        <tr>
            <td>{{++$index}}</td>
            <td>{{$value.id}}</td>
            <td>{{$value.advposname}}</td>
            <td> <img src="http://122.51.249.55:8083{{$value.advimgsrc}}" alt=""> </td>
            <td>{{$value.advimgdesc}}</td>
            <td> {{$value.advimglink}}</td>
            <td>
                <button type="button" data-src="{{$value.advimgsrc}}" data-desc="{{$value.advimgdesc}}" data-link="{{$value.advimglink}}" data-pos="{{$value.advposname}}" data-id="{{$value.id}}" class="layui-btn layui-btn-warm edit-btn" style="font-size=12px!important ;"></i>编辑</button>
                <button type="button" data-id="{{$value.id}}" class="layui-btn layui-btn-danger btn-delete"></i>删除</button>
            </td>
        </tr>
        {{/each}}
    </script>
    <!-- 修改dialog -->
    <script type="text/html" id="dialog-add">
        <form class="layui-form" id="edit-form" action="" lay-filter="editForm">
            <input type="hidden" name="advimgpos" value="">
            <input type="hidden" name="id" value="">
            <input type="hidden" name="act" value="edit">
            <div class="layui-form-item">
                <label class="layui-form-label">广告图位置</label>
                <div class="layui-input-block">
                    <input type="text" name="advimgpos" required lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">广告图描述</label>
                <div class="layui-input-block">
                    <input type="text" name="advimgdesc" required lay-verify="required" placeholder="请输入描述" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">广告图链接</label>
                <div class="layui-input-block">
                    <input type="text" name="advimglink" required lay-verify="required" placeholder="链接地址" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">广告图</label>
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" id="test99">
                        <i class="layui-icon">&#xe67c;</i>上传图片
                      </button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <div class="layui-input-block">
                    <img id="addimg" src="" alt="" width="100px">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn layui-btn-primary cancel">取消</button>
                    <button class="layui-btn" lay-submit lay-filter="formDemo">确定</button>
                </div>
            </div>
        </form>
    </script>
    <script src='./js/jquery.min.js'></script>
    <script src='./js/template-web.js'></script>
    <script src="./js/advimg.js"></script>
</body>
<script>
</script>


</html>